﻿using Class_Entity.ObjectOne;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataAccess.ObjectOne
{
    public class D_Service
    {
        SqlConnection con;
        DataTable tb = new DataTable();
        ConnectionToDataBase ex = new ConnectionToDataBase();
        public DataTable LoadService()
        {

            tb = ex.executeSelectQueryNonParameter("ViewAllService");
            return tb;
        }
        public DataTable LoadNews()
        {
            tb = ex.executeSelectQueryNonParameter("ViewAllNEWS");
            return tb;
           
        }
        public DataTable ServiceDetail(int val)
        {
            SqlParameter[] sqlParameters = new SqlParameter[1];
            sqlParameters[0] = new SqlParameter("@v_CCode", SqlDbType.Int);
            sqlParameters[0].Value = val;
            tb = ex.executeSelectQuery("SearchSERVICES_IDinDELIVERY_FEE_POLICIES", sqlParameters);
            return tb;            
        }
        public DataTable ServiceName(int val)
        {
            SqlParameter[] sqlParameters = new SqlParameter[1];
            sqlParameters[0] = new SqlParameter("@v_CCode", SqlDbType.Int);
            sqlParameters[0].Value = val;
            tb = ex.executeSelectQuery("SearchSERVICES_ID", sqlParameters);
            return tb;
        }
        
    }
}
